UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eAI+s6UtkxhuYaaEQ+WoDUXFOlKcDKsnNUFR53d3eHw='
WHERE
key_id = '5cd78357fe0eb62eb393d918337d4888504e31101d02322448074427f49bf751'
AND (
token = 'eAI+s6UtkxhuYaaEQ+WoDUXFOlKcDKsnNUFR53d3eHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)