UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hs+gWZU+kPYYhYrKted0BgYdnQDQ1sgFrBcFKujjI2o='
WHERE
key_id = '86ffb2d74aa5e61c0645e6d99c211a4bc77241d0d1f7f62968c02cc15eb71ff1'
AND (
token = 'hs+gWZU+kPYYhYrKted0BgYdnQDQ1sgFrBcFKujjI2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)