UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'imK+m1qlp1wwg9nARMGmBTc65zN/mKvQ2jOJQDb/4Os='
WHERE
key_id = '63a974df7f927b7dd45e353e97333043b2aaeeb2cb15566977de67ca100b2dfd'
AND (
token = 'imK+m1qlp1wwg9nARMGmBTc65zN/mKvQ2jOJQDb/4Os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)