UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hvxmPKex0fhnMWdIiPRzzWv1uktcmqUMfbyFhG376Z8=' 
WHERE 
  key_id = '3e9dafa49cc249a6f7013a9a98f4ba181c688b6659432e1e0e736e040e3893f8' 
  AND (
    token = 'hvxmPKex0fhnMWdIiPRzzWv1uktcmqUMfbyFhG376Z8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045