UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ulc4jWl2O6xpS4WLhFIy6CpfyCWzY46RNEyK7BVXtkk='
WHERE
key_id = 'fe4dbc31a2d9c383fb81f051e03215cf21587a69432b7656a332b10f018ac728'
AND (
token = 'Ulc4jWl2O6xpS4WLhFIy6CpfyCWzY46RNEyK7BVXtkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)