UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EP+EMtKoc7a3g77C3l6xAEHxlzhAbrdzwEO+oLfeXp8=' 
WHERE 
  key_id = '5d28b85a7da0ed68d53d2fb1ac4ecdac0f13dd7e265f0cddc5e3354eb958f6dc' 
  AND (
    token = 'EP+EMtKoc7a3g77C3l6xAEHxlzhAbrdzwEO+oLfeXp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020