UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41Rjax9xl0z6vvxCy4ZNhOu49crPdirZXtQp5WA0Cug='
WHERE
key_id = '0ac1cc83195e5f44def54af5b8a7b3caeee48682d38957d818fb4087ac36aee6'
AND (
token = '41Rjax9xl0z6vvxCy4ZNhOu49crPdirZXtQp5WA0Cug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)