UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IvcSYV0/Nq/cFFjvLfvnejC2Nus5n3Gfmf6D2/HmCbw=' 
WHERE 
  key_id = 'b0217952845c5b33b7aed619f07ab5e18d723e76aa3447b6274f9a33f5e6a73d' 
  AND (
    token = 'IvcSYV0/Nq/cFFjvLfvnejC2Nus5n3Gfmf6D2/HmCbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052