UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6RxEIzxusoMwDd5gkdrV+foDJHsT1gpEaKPolYiKv8g='
WHERE
key_id = 'cc91202a20c5a06ab78adb87aa9321f8d465e21132b286352543403d06c21642'
AND (
token = '6RxEIzxusoMwDd5gkdrV+foDJHsT1gpEaKPolYiKv8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)