UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'omoBglB3hibwrjFhcdXnyAUentlHlWmjvzqtzWORqMk='
WHERE
key_id = '8e103a56bc7df111a02556ec247d232341c8e62264ae7d9b5778315e9bcb6f4e'
AND (
token = 'omoBglB3hibwrjFhcdXnyAUentlHlWmjvzqtzWORqMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)