UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X6qsGkuzhnmMsQdTT+bU67jU9HMaikXXigbXx/eEgGI='
WHERE
key_id = '18b6e6ddffac7b15e3ca624826edc79942ef14b1383952d7ae3680ab37ab1f5e'
AND (
token = 'X6qsGkuzhnmMsQdTT+bU67jU9HMaikXXigbXx/eEgGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)