UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FkS1vasJUmm5gwoYMXEa1MG1/TVkQIJ0gZJxzXjR4ZQ=' 
WHERE 
  key_id = '1d36aadfc7bc7114b6ad03b4e5480cf9717cee5d7c0624e42ad2e30dc3d86c9d' 
  AND (
    token = 'FkS1vasJUmm5gwoYMXEa1MG1/TVkQIJ0gZJxzXjR4ZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034