UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UJWKDu9MRgA/HCySX76Hi9wp/SCmUJ1xOsNjxhvA+SI='
WHERE
key_id = 'e2f5acc5fb0ee3a8752f74995683cd4285729bfb21b5e44cc3cc5ab198929ab9'
AND (
token = 'UJWKDu9MRgA/HCySX76Hi9wp/SCmUJ1xOsNjxhvA+SI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)