UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4cd1Er3OAMiHyaU1WQUuI/ZLIudm/LRkd2ZNA4hpGWQ='
WHERE
key_id = 'e6c9fddc2677f12e085e27a358fd3eb58a6ad8f111a7aeb108cdb8e940a383ec'
AND (
token = '4cd1Er3OAMiHyaU1WQUuI/ZLIudm/LRkd2ZNA4hpGWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)