UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'adSaMFHYhb6MB7OT3a+adnBZOQ//H5nrmrFS0PwUHHE=' 
WHERE 
  key_id = '33783eda4c1c02a5198c9d9ef5c4217e2d2b1b8a95be6a53bffe91e6943c7d32' 
  AND (
    token = 'adSaMFHYhb6MB7OT3a+adnBZOQ//H5nrmrFS0PwUHHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031