UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KHMi3CjxB6qd4cj42wQUIzKIJiGQHaKQr6IygV/xhP0=' 
WHERE 
  key_id = '9dc7b299443b597aff5ff7df0d36ddba0ba19adaa73fa857d0f9048a1c279f4c' 
  AND (
    token = 'KHMi3CjxB6qd4cj42wQUIzKIJiGQHaKQr6IygV/xhP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034