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