UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'omIWOqKiR0uXhIGWTx1tH/KMqGowxbOlGY768cel13I='
WHERE
key_id = 'b29cc6d983d93c7fd338aae1bf0ddb27fa95ac14c0bdff506a4da5653dcb2265'
AND (
token = 'omIWOqKiR0uXhIGWTx1tH/KMqGowxbOlGY768cel13I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)