UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1jnjLqy88SPFYKlddtKVOWrWDMHVPjBQibfTUqRSca0=' 
WHERE 
  key_id = 'b3ab937676d55c4b938cbc2fdee3731e1b9f48b7e4dd7317ea99566e9a1317b8' 
  AND (
    token = '1jnjLqy88SPFYKlddtKVOWrWDMHVPjBQibfTUqRSca0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021