UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xG/cfVdDioQ/azNGbS3VTok2LrJ9hOTA6w7q1JKKivc='
WHERE
key_id = 'f9a3422bc8911035cc60b0e988af04035bb6cf209b17b330281a1eeeeea6fbf7'
AND (
token = 'xG/cfVdDioQ/azNGbS3VTok2LrJ9hOTA6w7q1JKKivc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)