UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tHUdbbTsJ4B+SmQa3CsTdsJLY+ZrTlB8+MKQnZU4eRU='
WHERE
key_id = 'ff51db5e953d9e80012a9c6699067cd665ce585379574286eccab64066abc0af'
AND (
token = 'tHUdbbTsJ4B+SmQa3CsTdsJLY+ZrTlB8+MKQnZU4eRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)