UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dhmO1Z4WxQPSTpmxYMknDWeajs5mMEuOFc/GbKPBHKs='
WHERE
key_id = '0945bd98e9fbc87861dab0eb1bc2abadc9936f353c38c48bac0a8fefa3969e4a'
AND (
token = 'dhmO1Z4WxQPSTpmxYMknDWeajs5mMEuOFc/GbKPBHKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)