UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFZcfxsn1wYg6OTa+JbU7c+zDqhMi+Ru3m6QuITHAU4=' 
WHERE 
  key_id = '750fa6749dbb77bca97159b56dac2ce97af77330c556976041425c17e210c0fc' 
  AND (
    token = 'kFZcfxsn1wYg6OTa+JbU7c+zDqhMi+Ru3m6QuITHAU4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088