UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NbNkNRQuCjBqq5WCvtHS92ea6DjcXSXWSPZcB73GKU4='
WHERE
key_id = '181219dd397d6372e7f8e6f97e093f0601d389f2bfa6d03e6b36f317047b3d44'
AND (
token = 'NbNkNRQuCjBqq5WCvtHS92ea6DjcXSXWSPZcB73GKU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)