UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IDnHOYTD72K5/MlrfuArq/GvFz7iWt3+tdAMbQcoIdo='
WHERE
key_id = 'ac5e162973678d81b64550213c37c8cfda0b0fcdd44c9edad7eccff2ddf66fb4'
AND (
token = 'IDnHOYTD72K5/MlrfuArq/GvFz7iWt3+tdAMbQcoIdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)