UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ThPTS4FH4FS5pl9eJ2BKvbKbJOJdil0a+pp2/CK5FwE=' 
WHERE 
  key_id = '2355bac5ae045fb17cc23636c98d86948c3e95658a4fcc6fdc287a762fe6bdaf' 
  AND (
    token = 'ThPTS4FH4FS5pl9eJ2BKvbKbJOJdil0a+pp2/CK5FwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023