UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bS88aGid2DAfol8TEjHBGHwpzcsQQiWlngOJgFWpluc=' 
WHERE 
  key_id = 'ee025091af1f0982395e30e2c54d3fc23f220220a876972e9aa0ad6ff4c0cee3' 
  AND (
    token = 'bS88aGid2DAfol8TEjHBGHwpzcsQQiWlngOJgFWpluc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017