UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tq49E3/5JK60C5otJKzU0vJ5WdjbGh7c1c4bk9PwSu4='
WHERE
key_id = 'a98c5d9bf632a91d6ac1791a08d7283656bc53495684af539868bd3284fb4e6c'
AND (
token = 'Tq49E3/5JK60C5otJKzU0vJ5WdjbGh7c1c4bk9PwSu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)