UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jefuipB5K+fwqQUJ/D1IvW82I9lo9KL3K0DY5IoTK+s='
WHERE
key_id = 'be97ffd85c52f9d4175eb677077d760f49485bb1bc63634fe1318d4fc73e53f6'
AND (
token = 'jefuipB5K+fwqQUJ/D1IvW82I9lo9KL3K0DY5IoTK+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)