UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yD4BAzrNnQtuLf95ymtU6WDTTfU7M84OnE4YX3LI6+Y='
WHERE
key_id = '1ea471b5cfd3c6a7c7b516ef3096431f76e1ec55d128f63b564afe081681ba3f'
AND (
token = 'yD4BAzrNnQtuLf95ymtU6WDTTfU7M84OnE4YX3LI6+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)