UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lBMDI9Vr3XohHC8bdcGfRUM2KOFMDkR9Y+pJSX5FarM='
WHERE
key_id = 'dffeda527d8b1f8d6fb3c43d2e6f4b105383dc076d673c14d8c63b30b181094d'
AND (
token = 'lBMDI9Vr3XohHC8bdcGfRUM2KOFMDkR9Y+pJSX5FarM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)