UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FMCPhWRSuml4LLgDnNgx6JuOX7x+1Vkf7D2xMDqvCRE='
WHERE
key_id = '8c7025de62def82650c49bd7d4e5bdf816b0f0b79714d781b96087b165fa6290'
AND (
token = 'FMCPhWRSuml4LLgDnNgx6JuOX7x+1Vkf7D2xMDqvCRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)