UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IFcchIKRvNzfZHJsOOPGvZ8uEe7Co4L4BQIqdz2hyjg='
WHERE
key_id = '12e8a66d868a91d92683b4bddfdf2e18c63bdaccee302392dd69484a5630b43c'
AND (
token = 'IFcchIKRvNzfZHJsOOPGvZ8uEe7Co4L4BQIqdz2hyjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)