UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VtizsAeFHdm6QqcfsKT3WDeUuOrs7Tn2+ScXwxT3eSE='
WHERE
key_id = '3935e2c4500dcc4cfa9c2b960e1c52b400397b976f518558e7e89e08460cbcb4'
AND (
token = 'VtizsAeFHdm6QqcfsKT3WDeUuOrs7Tn2+ScXwxT3eSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)