UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AW55Q2WiWBOv6rNxHNq5+bsAplLYXKwfH4LzH2TLMIk='
WHERE
key_id = '20ad43f0a7abab3e4069ec0883b50e14f1781a83c9d8b7aa1b9fd24532fd2e6a'
AND (
token = 'AW55Q2WiWBOv6rNxHNq5+bsAplLYXKwfH4LzH2TLMIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)