UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jRIr/2avd7KlGFznLCuu6K9jBOJqaOMMWysq9gEqO6A='
WHERE
key_id = '39f42c1f8463eb8e8451897fcab5894cc2ff51390db7945715381a128620cc91'
AND (
token = 'jRIr/2avd7KlGFznLCuu6K9jBOJqaOMMWysq9gEqO6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)