UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8VfpsfdmrLMrv89HkwTULz+Jhcm3ATld7VOKuByOysI='
WHERE
key_id = '5b36fe25d2f685cdcb16f2e8b946c35f09450a86b731ea12c42a37fa31e778c1'
AND (
token = '8VfpsfdmrLMrv89HkwTULz+Jhcm3ATld7VOKuByOysI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)