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