UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uixkAoVgVn9eKBpROkJplGvT7vhl/YhqodbyTD7er7I='
WHERE
key_id = '02c64ba4b71ee32b0d5d0f1cccb026ee8fa973ab35523ec1d8087d24b79d7fd9'
AND (
token = 'uixkAoVgVn9eKBpROkJplGvT7vhl/YhqodbyTD7er7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)