UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9pxvQtz7/cH3NW7aEM6IMsa6NDVE0YWHEqOuqWzBf1c='
WHERE
key_id = '5e0cf07cf54ecfff972cf302ee14aac780c380a88426bf4527970e99dfd9dd99'
AND (
token = '9pxvQtz7/cH3NW7aEM6IMsa6NDVE0YWHEqOuqWzBf1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)