UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IxNqwOsKQS+l6uvjfEN87fZUYDCrzpsXqX/U4MxwFKo=' 
WHERE 
  key_id = 'f9670fcb7f102effa29cfcbaf3965d31bf5fb594ae0e7671adb9be252df1e5c9' 
  AND (
    token = 'IxNqwOsKQS+l6uvjfEN87fZUYDCrzpsXqX/U4MxwFKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016