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