UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EAcReMt3nvdSa4JlN421/BafTyuZ3tLlyV930V7dWuM='
WHERE
key_id = 'b52494193fb875a3d344f85ef79bd0a0db01ec0f33ff31d1eb10a043b8c44e26'
AND (
token = 'EAcReMt3nvdSa4JlN421/BafTyuZ3tLlyV930V7dWuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)