UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NIDsdYQML4EkriljMYdgRwBwJmY79aTfUAtfMP/mx9U='
WHERE
key_id = '32c24bf0cb11c96fc1805e202f34502e249c60d19fe0a143bf0ccd1320d672dd'
AND (
token = 'NIDsdYQML4EkriljMYdgRwBwJmY79aTfUAtfMP/mx9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)