UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '72+fJkgzmRDlWdv8N37IPpzDpCWCE4xo0rGWPPng720='
WHERE
key_id = 'c89263edf1f7cb18216d8a874dce0ea50ccce61569c04eae47d2a80ed6a858fe'
AND (
token = '72+fJkgzmRDlWdv8N37IPpzDpCWCE4xo0rGWPPng720='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)