UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6XwZSYLTeYLESM6Fbuh3hzSw20sADOVIYM8ClgjehfU='
WHERE
key_id = '2fde71d11ff870fa415d36d4a91660a991abdbbb93f777394542bc67ba61bd2c'
AND (
token = '6XwZSYLTeYLESM6Fbuh3hzSw20sADOVIYM8ClgjehfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)