UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4tqVfIdVLt2M++4SKwy5qovFQVqvVCsishVguxVbzBo=' 
WHERE 
  key_id = '3e0d3f3efcc6a7b3c909e58fc7d8ae7a5dbb255e0ff0d58bdb3a3316add457e7' 
  AND (
    token = '4tqVfIdVLt2M++4SKwy5qovFQVqvVCsishVguxVbzBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027