UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e9PFqlAqCav7m7KJhAQFxebwzQJ+3jwdAGNLBrsMLm0=' 
WHERE 
  key_id = '59eab5176f5fe20e1cac050189055e9591f0d5fff4b4d60a0facae476f31b90b' 
  AND (
    token = 'e9PFqlAqCav7m7KJhAQFxebwzQJ+3jwdAGNLBrsMLm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032