UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uKBMLlQpOPqPL8l7Wi2uXpuNciW0ZlLDmWtfZIF/Ab8=' 
WHERE 
  key_id = 'c35621e45cd8e226b0bba0add5695bda8f0764f4de6e989bdca7fc1e20099b39' 
  AND (
    token = 'uKBMLlQpOPqPL8l7Wi2uXpuNciW0ZlLDmWtfZIF/Ab8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034